using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class br_ReportListMap : EntityTypeConfiguration<br_ReportList>
    {
        public br_ReportListMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Title)
                .IsRequired()
                .HasMaxLength(79);

            this.Property(t => t.level1)
                .IsRequired()
                .HasMaxLength(38);

            this.Property(t => t.level2)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.template)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.Description)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.type)
                .IsRequired()
                .HasMaxLength(1);

            this.Property(t => t.Project)
                .IsRequired()
                .HasMaxLength(4);

            this.Property(t => t.FunctionCode)
                .IsRequired()
                .HasMaxLength(7);

            this.Property(t => t.options)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.T_Char1)
                .HasMaxLength(100);

            this.Property(t => t.T_Char2)
                .HasMaxLength(100);

            this.Property(t => t.T_Char3)
                .HasMaxLength(100);

            this.Property(t => t.T_Char4)
                .HasMaxLength(100);

            this.Property(t => t.T_Char5)
                .HasMaxLength(100);

            this.Property(t => t.T_Char6)
                .HasMaxLength(100);

            this.Property(t => t.T_Char7)
                .HasMaxLength(100);

            this.Property(t => t.T_Char8)
                .HasMaxLength(100);

            this.Property(t => t.T_Char9)
                .HasMaxLength(100);

            this.Property(t => t.T_Char10)
                .HasMaxLength(100);

            this.Property(t => t.T_Char11)
                .HasMaxLength(100);

            this.Property(t => t.T_Char12)
                .HasMaxLength(100);

            this.Property(t => t.T_Char13)
                .HasMaxLength(100);

            this.Property(t => t.T_Char14)
                .HasMaxLength(100);

            this.Property(t => t.T_Char15)
                .HasMaxLength(100);

            this.Property(t => t.T_Date1)
                .HasMaxLength(100);

            this.Property(t => t.T_Date2)
                .HasMaxLength(100);

            this.Property(t => t.T_Money1)
                .HasMaxLength(100);

            this.Property(t => t.T_Money2)
                .HasMaxLength(100);

            this.Property(t => t.T_Int1)
                .HasMaxLength(100);

            this.Property(t => t.T_Int2)
                .HasMaxLength(100);

            this.Property(t => t.T_Int3)
                .HasMaxLength(100);

            this.Property(t => t.ReportProcedure)
                .HasMaxLength(100);

            this.Property(t => t.ReportCode)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("br_ReportList");
            this.Property(t => t.Title).HasColumnName("Title");
            this.Property(t => t.level1).HasColumnName("level1");
            this.Property(t => t.level2).HasColumnName("level2");
            this.Property(t => t.template).HasColumnName("template");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.type).HasColumnName("type");
            this.Property(t => t.Project).HasColumnName("Project");
            this.Property(t => t.sort).HasColumnName("sort");
            this.Property(t => t.FunctionCode).HasColumnName("FunctionCode");
            this.Property(t => t.options).HasColumnName("options");
            this.Property(t => t.Hide).HasColumnName("Hide");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.T_Char1).HasColumnName("T_Char1");
            this.Property(t => t.T_Char2).HasColumnName("T_Char2");
            this.Property(t => t.T_Char3).HasColumnName("T_Char3");
            this.Property(t => t.T_Char4).HasColumnName("T_Char4");
            this.Property(t => t.T_Char5).HasColumnName("T_Char5");
            this.Property(t => t.T_Char6).HasColumnName("T_Char6");
            this.Property(t => t.T_Char7).HasColumnName("T_Char7");
            this.Property(t => t.T_Char8).HasColumnName("T_Char8");
            this.Property(t => t.T_Char9).HasColumnName("T_Char9");
            this.Property(t => t.T_Char10).HasColumnName("T_Char10");
            this.Property(t => t.T_Char11).HasColumnName("T_Char11");
            this.Property(t => t.T_Char12).HasColumnName("T_Char12");
            this.Property(t => t.T_Char13).HasColumnName("T_Char13");
            this.Property(t => t.T_Char14).HasColumnName("T_Char14");
            this.Property(t => t.T_Char15).HasColumnName("T_Char15");
            this.Property(t => t.T_Date1).HasColumnName("T_Date1");
            this.Property(t => t.T_Date2).HasColumnName("T_Date2");
            this.Property(t => t.T_Money1).HasColumnName("T_Money1");
            this.Property(t => t.T_Money2).HasColumnName("T_Money2");
            this.Property(t => t.T_Int1).HasColumnName("T_Int1");
            this.Property(t => t.T_Int2).HasColumnName("T_Int2");
            this.Property(t => t.T_Int3).HasColumnName("T_Int3");
            this.Property(t => t.ReportProcedure).HasColumnName("ReportProcedure");
            this.Property(t => t.ReportCode).HasColumnName("ReportCode");
            this.Property(t => t.RL_ShowFormats).HasColumnName("RL_ShowFormats");
        }
    }
}
